home *** CD-ROM | disk | FTP | other *** search
-
- if {[string compare test [info procs test]] == 1} then \
- {source defs}
-
- # set VERBOSE 1
-
- xtAppInitialize -class Arrow
- . setValues -allowShellResize true
-
- ###################################
- # setup PushButton for some tests #
- ###################################
-
- xmPushButton .btn managed \
- -labelString hello \
- -width 100
-
- . realizeWidget
-
- ####################
- # XmString to String
- ####################
-
- test converters-1.1 {convert XmString to String} {
- .btn getValues -labelString l
- set l
- } {hello}
-
- ###################
- # Boolean to String
- ###################
-
- test converters-2.1 {convert Boolean to String} {
- .btn setValues -fillOnArm true
- .btn getValues -fillOnArm f
- set f
- } {true}
-
- test converters-2.2 {convert Boolean to String} {
- .btn setValues -fillOnArm false
- .btn getValues -fillOnArm f
- set f
- } {false}
-
- #####################
- # Dimension to String
- #####################
-
- test converters-3.1 {convert Dimension to String} {
- .btn getValues -width w
- set w
- } {100}
-
- .btn destroyWidget
-
- #############################
- # setup List for some tests #
- #############################
-
- xmList .list managed \
- -items "a b c {d e f}" \
- -itemCount 4
-
- #########################
- # XmStringTable to String
- #########################
-
- test converters-4.1 {convert XmStringTable to String} {
- .list getValues -items i
- set i
- } {a b c {d e f}}
-
- ###############
- # Int to String
- ###############
-
- test converters-5.1 {convert int to String} {
- .list getValues -itemCount n
- set n
- } {4}
-
- .list destroyWidget
-
- #############################
- # setup form for some tests #
- #############################
-
- xmForm .convform managed
- xmLabel .convform.l1 managed
- xmLabel .convform.l2 managed \
- -topAttachment attach_widget \
- -topWidget .convform.l1
-
- ##################
- # widget to String
- ##################
-
- test converters-6.1 {convert widget to string} {
- .convform.l2 getValues -topWidget t
- set t
- } {.convform.l1}
-
- ####################
- # String to XmString
- ####################
-
- test converters-6.2 {convert string to XmString} {
- .convform.l1 setValues \
- -labelString "hello"
- .convform.l1 getValues \
- -labelString l
- set l
- } {hello}
-
- .convform.l1 destroyWidget
- .convform.l2 destroyWidget
- .convform destroyWidget
-
- test converters-7.1 {convert string to WidgetClass} {
- xmRowColumn .row \
- -isHomogeneous true \
- -entryClass XmPushButton
- xmPushButton .row.btn
- puts stdout "There should be a warning from Xt: \" Attempt to add wrong type child to a homogeneous RowColumn widget\""
- xmLabel .row.label
- puts stdout "End of Xt warning"
- } {}
-
- .row destroyWidget
-
- # we don't want to go into interactivity:
- # . mainLoop
-